flutter how to create copy button

83

RaisedButton(
  child: Text('Copy'),
  onPressed: () {
    ClipboardManager.copyToClipBoard(
            _variableContainingString)
        .then((result) {
      final snackBar = SnackBar(
        content: Text('Copied to Clipboard'),
        action: SnackBarAction(
          label: 'Undo',
          onPressed: () {},
        ),
      );
      Scaffold.of(context).showSnackBar(snackBar);
    });
  },
),
ClipboardManager.copyToClipBoard(valueText) // This

Comments

Submit
0 Comments